function commenting(konten,user) {
	if (document.getElementById('form-komen').value.length == 0) {
		alert('Isi komentar untuk ngomentar');
		document.getElementById('form-komen').focus();
	} else {
		var lkomen = document.getElementById('lkomen').innerHTML;
		var jmlkomen = document.getElementById('jmlkomen').innerHTML;
		jmlkomen++;
		var isi = document.getElementById('form-komen').value;
		
		xmlhttp=mintajax();
		xmlhttp.onreadystatechange=function()
		{
		  if (xmlhttp.readyState== 4 && xmlhttp.status== 200)
		  {
			//json xmlhttp.responseText;
			lkomen = xmlhttp.responseText + lkomen;
			document.getElementById('lkomen').innerHTML = lkomen;
			document.getElementById('jmlkomen').innerHTML = jmlkomen;
			document.getElementById('form-komen').value = "";
		  }
		}
		xmlhttp.open("GET","komen.php?kid="+konten+"&user="+user+"&isi="+isi+"&jml="+jmlkomen+"&jenis=1",true);
		xmlhttp.send(null);
	}
}

function deleting(konten,user){
	var jmlkomen = document.getElementById('jmlkomen').innerHTML;
	jmlkomen--;
	var isi = document.getElementById('judul-isi').innerHTML;
	
	xmlhttp=mintajax();
	xmlhttp.onreadystatechange=function()
	{
	  if (xmlhttp.readyState== 4 && xmlhttp.status== 200)
	  {
		var child = document.getElementById('komen'+konten);
		var parent = document.getElementById('lkomen');
		parent.removeChild(child);
		document.getElementById('jmlkomen').innerHTML = jmlkomen;
		//alert(xmlhttp.responseText);
	  }
	}
	xmlhttp.open("GET","komen.php?kid="+konten+"&user="+user+"&isi="+isi+"&jml="+jmlkomen+"&jenis=2",true);
	xmlhttp.send(null);
}